<extend name="./Apps/Home/View/default/users/layout.html" />
<block name="content">
    <div class="wst-body"> 
       <div class='wst-page-header'>买家中心 > 商城消息 > 查看消息</div>
       <div class='wst-page-content'>        
        <div class='wst-tbar-group'>
           <a href='javascript:batchMessageDel()' class='del btn'>删除</a>           
        </div>
        <table class='wst-list'>
           <thead>
             <tr>
               <th width='20'><input type='checkbox' onclick='javascript:WST.checkChks(this,".chk")'/></th>
               <th width='40'>状态</th>
               <th>消息</th>
               <th width='100'>操作</th>
             </tr>
           </thead>
           <tbody>
            <volist name="Page['root']" id="vo" key='i'>
             <tr>
               <td><input class='chk' type='checkbox' value='{$vo['id']}'/></td>
               <td>
               <if condition="$vo['msgStatus'] == 1 ">
               <div class='readMsg'></div>
               <else/>
               <div class='newMsg'></div>
               </if>
               </td>
               <td>{$vo['msgContent']}</td>
               <td>
               <a href="{:U('Home/Messages/showMessage',array('id'=>$vo['id']))}">[查看详情]</a>
               &nbsp;
               </td>
             </tr>
             </volist>
             <tfoot>
             <tr>
                <td colspan='12' align='center'>
                <div class="wst-page" style="float:right;padding-bottom:10px;">
						<div id="wst-page-items"></div>
				</div>
                <script>
			    <if condition="$Page['totalPage'] gt 1">
			    $(document).ready(function(){
					laypage({
					    cont: 'wst-page-items',
					    pages: {$Page['totalPage']}, //总页数
					    skip: true, //是否开启跳页
					    skin: '#e23e3d',
					    groups: 3, //连续显示分页数
					    curr: function(){ //通过url获取当前页，也可以同上（pages）方式获取
					        var page = location.search.match(/p=(\d+)/);
					        return page ? page[1] : 1;
					    }(), 
					    jump: function(e, first){ //触发分页后的回调
					        if(!first){ //一定要加此判断，否则初始时会无限刷新
					        	var nuewurl = WST.splitURL("p");
					        	var ulist = nuewurl.split("?");
					        	if(ulist.length>1){
					        		location.href = nuewurl+'&p='+e.curr;
					        	}else{
					        		location.href = '?p='+e.curr;
					        	}
					            
					        }
					    }
					});
			    });
				</if>
				</script>
                </td>
             </tr>
             </tfoot>
           </tbody>
        </table>
        <div class='wst-tbar-group'>
           <a href='javascript:batchMessageDel()' class='del btn'>删除</a>
        </div>
        </div>
    </div>
</block> 